package SoftwarePrinciple.OpenClosePrinciple;

/**
 * @author: Themberfue
 * @date: 2025/8/7 11:24
 * @description:
 */
// 面积计算器（无需修改即可支持新形状）
public class AreaCalculator {
    // 计算所有形状的总面积
    public double calculateTotalArea(Shape[] shapes) {
        double totalArea = 0;
        for (Shape shape : shapes) {
            totalArea += shape.calculateArea();
        }
        return totalArea;
    }
}

